<div class="container-fluid">
    <div class="row mb-3">
        <div class="col">
            <h3>部门管理</h3>
        </div>
        <div class="col text-end">
            <button class="btn btn-primary" onclick="showAddDepartmentModal()">
                <i class="bi bi-plus"></i> 添加部门
            </button>
        </div>
    </div>

    <div class="card">
        <div class="card-body">
            <table class="table">
                <thead>
                    <tr>
                        <th>部门名称</th>
                        <th>描述</th>
                        <th>负责人</th>
                        <th>创建时间</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody id="departmentTableBody">
                    <!-- 部门数据将在这里动态加载 -->
                </tbody>
            </table>
        </div>
    </div>
</div>

<!-- 添加/编辑部门模态框 -->
<div class="modal fade" id="departmentModal" tabindex="-1">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="departmentModalTitle">添加部门</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
            </div>
            <div class="modal-body">
                <form id="departmentForm">
                    <input type="hidden" id="departmentId">
                    <div class="mb-3">
                        <label for="departmentName" class="form-label">部门名称</label>
                        <input type="text" class="form-control" id="departmentName" required>
                    </div>
                    <div class="mb-3">
                        <label for="departmentDescription" class="form-label">描述</label>
                        <textarea class="form-control" id="departmentDescription" rows="3"></textarea>
                    </div>
                    <div class="mb-3">
                        <label for="departmentManager" class="form-label">负责人</label>
                        <input type="text" class="form-control" id="departmentManager">
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" onclick="saveDepartment()">保存</button>
            </div>
        </div>
    </div>
</div> 